package young.twentyone.hwang.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper{
	private static final int DATABASE_VERSION=1;
	
	static final String DATABASE_NAME="twentyonetodo.db";
	static final String TWENTYONE = "twentyone";
	static final String TODOLIST = "todolist";

	public DatabaseHelper(Context context) {
		super(context, DATABASE_NAME, null, DATABASE_VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(Database_sql.CREATE_TWENTYONE);
		db.execSQL(Database_sql.CREATE_TODOLIST);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL(Database_sql.DROP_TWENTYONE);
		db.execSQL(Database_sql.DROP_TODOLIST);
		onCreate(db);
		
	}
	public void onOpen(SQLiteDatabase db){
		super.onOpen(db);
	}

}
